<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text" onfocus="testFocus()" onblur="testBlur()">
    <input type="text" onchange="testChange()">
    <select onchange="testChange()">
        <option>A</option>
        <option>AA</option>
        <option>AAA</option>
    </select>

    <script>
        function testFocus() {
            console.log("获得焦点事件");
            //alert("获得焦点事件");
        }

        function testBlur() {
            console.log("失去焦点事件");
        }

        function testChange() {
            console.log("内容改变事件");
        }
    </script>
</body>
</html>